package com.letao.controller;

import com.letao.common.pojo.PictureResult;
import com.letao.common.utils.JsonUtils;
import com.letao.service.PictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

/**
 * Created by ac on 2017/1/10.
 */
@Controller
@RequestMapping("/pic")
public class PictureController {

    @Autowired
    private PictureService pictureService;

    @RequestMapping("/upload")
    @ResponseBody
    public String upload(MultipartFile uploadFile){
        return JsonUtils.objectToJson(pictureService.uploadFile(uploadFile));
    }

}
